﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddFactor.ascx.cs" Inherits="controls_AddFactor" %>
<asp:Panel ID="pMain" runat="server">
    <div class="formContainer">
        <div class="formFieldElement_fullwidth">
            <asp:Label ID="Label1" runat="server" Text="Factor Name:" /><span class="formStar_RequireField">
                *</span>
            <br />
            <asp:TextBox ID="tbxFactorName" runat="server" Width="200px" />
            <asp:RequiredFieldValidator ID="valrFactorName" runat="server" Display="None" ErrorMessage="Please, specify factor name"
                ControlToValidate="tbxFactorName" />
            <asp:CustomValidator ID="valcFactorName" runat="Server" ValidationGroup="FactorName"
                Display="None" OnServerValidate="CheckFactorName" ErrorMessage="Factor with this name already exists"
                ControlToValidate="tbxFactorName" ValidateEmptyText="True" />
        </div>
        <div class="formFieldElement_fullwidth">
            <asp:Label ID="Label2" runat="server" Text="Category:" />
            <br />
            <asp:DropDownList ID="dropdownCategories" runat="server" Width="200px" DataSourceID="categoryDS"
                DataTextField="Name" DataValueField="CategoryID">
            </asp:DropDownList>
            <br /><br />
            <asp:Label ID="Label4" runat="server" Text="Scale Type:" />
            <br />
            <asp:DropDownList ID="dropdownScaleType" runat="server" Width="200px">
                <asp:ListItem Value="0">Nominal</asp:ListItem>
                <asp:ListItem Value="1">Ordinal</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="formFieldElement_fullwidth">
            <asp:Label ID="Label3" runat="server" Text="Factor Scales:" />
            <br />
            <div style="float: left">
                <asp:Panel ID="pScales" runat="Server" Width="220px">
                </asp:Panel>
                <asp:CustomValidator ID="valcScales" runat="Server" ValidationGroup="FactorName"
                    Display="None" OnServerValidate="IsScaleValuesUnique" ErrorMessage="Scale values should be different"
                    ControlToValidate="tbxFactorName" ValidateEmptyText="True" />
            </div>
            <asp:Button ID="Button1" runat="server" Text="More" OnClick="btnMoreClick" CssClass="formButton"
                CausesValidation="false" />
            <asp:Button ID="btnSaveScales" runat="server" Text="Save" CssClass="formButton" OnClick="btnSaveClick" />            
        </div>
        <div style="clear: both; display: block; height: 2px;">
            &nbsp;</div>
        <div class="formFieldElement_fullwidth">
            <asp:ValidationSummary ID="valsClientSide" runat="server" class="formValidator_RequireField" />
            <asp:ValidationSummary ID="valsServerSide" runat="server" class="formValidator_RequireField"
                ValidationGroup="FactorName" />
        </div>
        <div style="clear: both; display: block; height: 2px;">
            &nbsp;</div>
    </div>
</asp:Panel>
<asp:EntityDataSource ID="categoryDS" runat="server" ConnectionString="name=ProjectStorageEntities"
    DefaultContainerName="ProjectStorageEntities" EnableFlattening="False" EntitySetName="FactorCategories">
</asp:EntityDataSource>
